package com.hm.cms.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.hm.cms.auto.ControllerResult;
import com.hm.cms.auto.R;
import com.hm.cms.service.TermTaxonomyService;
import com.hm.cms.vo.HcmsTermTaxonomyVo;
import com.hm.common.su.bean.ServerResponse;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * @author shishun.wang
 * @date 下午3:48:42 2017年11月9日
 * @version 1.0
 * @describe 
 */
@ResponseBody
@RestController
@RequestMapping(R.Restful.API + "/ttaxonomy")
public class TermTaxonomyApi {

	private static final String SWWAGER_TAG = "标签管理";

	@Autowired
	private TermTaxonomyService termTaxonomyService;

	@RequestMapping(method = RequestMethod.POST)
	@ApiOperation(tags = SWWAGER_TAG, value = "新增标签", httpMethod = "POST", notes = "新增标签,返回添加是否成功")
	public ResponseEntity<ServerResponse<Boolean>> addTerms(
			@ApiParam(required = true, name = "body") @RequestBody(required = true) HcmsTermTaxonomyVo taxonomyVo) {
		termTaxonomyService.addTermTaxonomy(taxonomyVo, "1");
		return ControllerResult.success(true);
	}
}
